#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   Set_up.py
@Time    :   2025/04/17 18:00:00
@Author  :   yangliang 
@Version :   1.0
@Contact :   yangl@genvict.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

import datetime
import  os
from ssl import CHANNEL_BINDING_TYPES
from xml.dom.expatbuilder import FilterVisibilityController
from commDriver.zlg.zlgcan import *



# HW config
#CAN
drive_type = 'USE_TS_TC1013_DEVICE'     # 同星CAN
CAN_Type = 'CAN'
if CAN_Type == 'CAN':
    configure_baudrate = {'CAN_Type':'CAN','ArbRate':500,'DataRate':500,'TermResistor':True}
else:
    configure_baudrate = {'CAN_Type':'CANFD','ArbRate':500,'DataRate':2000,'TermResistor':True}

#drive_type = ZCAN_USBCANFD_200U        #周立功CAN
# drive_index = 0
# chn_index = 0
# can_abit = 500000
# can_bbit = 2000000

# can_Type = 'CANFD'


power_Type = 'IT6720' # 2303 or IT6720
gpib_address = 'GPIB0::16::INSTR'


#Dbc define
root = os.getcwd()
project_DBC_File_CAN = os.path.join(root, r'data\ZSDB125200_DC1E_A3.dbc')
blfname = datetime.datetime.now().strftime('%y%m%d') + '.blf'
project_BLF_File_CAN = os.path.join(root, fr"blf\{blfname}")
NetName = 'DC1E'
nodeName= 'ECUs'
EnableNode = ['ETCM']

#Power Config
source='Power'           #电源名称,可以使用NIMAX查看
baudrate=9600

#Dbc UDS
reqID = 0x774
resID = 0x674
AFctID = 0x7FF

ActiveReqID = 0x0C1
ActiveResID = 0x0F0



jidianqiPort = 'COM4'
jidianqiBaudrate = 9600
jidianqiTimeOut = 0.3

M600Tport = 'COM8'
M600Tbaudrate = 115200  
M600TTimeOut = 1

CanPrint = True

VIN = [0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37]


bootver = [10]
# # 软件版本号
OBU_Software_Version = 'OBUC524_ZEEKR_V1.0.0_250423'

Dut_Type = 'DC1E-A3'


